//
// Created by Administrator on 2023/8/2.
//

#include <iostream>
#include <string>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <queue>
#include <cmath>
#include <algorithm>

#include <map>
#include <set>

using namespace std;

class Solution {
public:
    int minPartitions(string n) {
        // n中的最大值
        char maxChar = '0';
        for (auto c : n) {
            maxChar = max(maxChar,c);
        }
        return maxChar - '0';
    }
};

int main() {
    Solution solution = Solution();
    string n = "27346209830709182346";
    int result = solution.minPartitions(n);
    cout << result << endl;
    return 0;
}